package com.bytz.modules.cms.order.model;

import com.bytz.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@ApiModel(value = "经销商侧订单model")
public class OrderModel {

    @ApiModelProperty(value = "订单ID")
    private String id;

    @ApiModelProperty(value = "经销商ID")
    private String resellerId;

    @ApiModelProperty(value = "产品线Code")
    private String productLineCode;

    @ApiModelProperty(value = "需方订单号")
    private String orderNumber;

    @ApiModelProperty(value = "订单类别（1-标准订单；2-项目订单）")
    @NotEmpty(message = "订单类别不能为空")
    @Dict(dicCode = "mall_order_type")
    private String orderType;

    @ApiModelProperty(value = "合同号")
    private String contractNumber;

    @ApiModelProperty(value = "合同盖章后文件")
    private String contractSignedFile;

    @ApiModelProperty(value = "双章合同文件")
    private String contractResellerFile;

    @ApiModelProperty(value = "项目名称")
    private String projectName;

    @ApiModelProperty(value = "签约地点")
    private String signedPlace;

    @ApiModelProperty(value = "币种")
    private String currency;

    @ApiModelProperty(value = "增值税税率")
    private BigDecimal taxRate;

    @NotEmpty(message = "需方用户id不能为空")
    @ApiModelProperty(value = "需方用户id")
    private String demanderId;

    @NotEmpty(message = "需方客户编码id不能为空")
    @ApiModelProperty(value = "需方客户编码")
    private String demanderNumber;

    @NotEmpty(message = "需方单位名称id不能为空")
    @ApiModelProperty(value = "需方单位名称")
    private String demanderName;

    @NotEmpty(message = "需方单位地址id不能为空")
    @ApiModelProperty(value = "需方单位地址")
    private String demanderAddress;

    @ApiModelProperty(value = "需方邮政编码")
    private String demanderPostcode;

    @ApiModelProperty(value = "需方委托代理人")
    private String demanderAgent;

    @ApiModelProperty(value = "需方电话")
    private String demanderPhone;

    @ApiModelProperty(value = "需方传真")
    private String demanderFax;

    @ApiModelProperty(value = "需方签约日期：订单提交日期")
    private LocalDateTime demanderSignedDate;

    @ApiModelProperty(value = "供方单位名称")
    @NotEmpty(message = "供方单位不能为空")
    private String supplierName;

    @ApiModelProperty(value = "供方单位地址")
    @NotEmpty(message = "供方单位地址不能为空")
    private String supplierAddress;

    @ApiModelProperty(value = "供方邮政编码")
    private String supplierPostcode;

    @ApiModelProperty(value = "销售人员ID")
    @NotEmpty(message = "销售人员不能为空")
    private String salesId;

    @ApiModelProperty(value = "销售人员名字 (供方委托代理人)")
    private String salesName;

    @ApiModelProperty(value = "销售外部编号")
    private String salesExternalId;

    @ApiModelProperty(value = "供方电话")
    private String supplierPhone;

    @ApiModelProperty(value = "供方传真")
    private String supplierFax;

    @ApiModelProperty(value = "供方签约日期：订单审批完成日期")
    private LocalDateTime supplierSignedDate;

    @ApiModelProperty(value = "需方交付用户id")
    @NotEmpty(message = "需方交付用户不能为空")
    private String shipToId;

    @ApiModelProperty(value = "需方交付客户编码")
    @NotEmpty(message = "需方交付用户不能为空")
    private String shipToNumber;

    @ApiModelProperty(value = "需方交付单位名称")
    @NotEmpty(message = "需方交付单位不能为空")
    private String shipToName;

    @ApiModelProperty(value = "需方交付单位地址")
    @NotEmpty(message = "需方交付单位地址不能为空")
    private String shipToAddress;

    @ApiModelProperty(value = "需方交付联系人")
    private String shipToContact;

    @ApiModelProperty(value = "需方交付联系人电话")
    private String shipToPhone;

    @ApiModelProperty(value = "终端用户id")
    @NotEmpty(message = "终端用户不能为空")
    private String endUserId;

    @ApiModelProperty(value = "终端客户编码")
    @NotEmpty(message = "终端客户编码不能为空")
    private String endUserNumber;

    @ApiModelProperty(value = "终端用户单位名称")
    @NotEmpty(message = "终端用户单位名称不能为空")
    private String endUserName;

    @ApiModelProperty(value = "终端用户单位地址")
    @NotEmpty(message = "终端用户单位地址不能为空")
    private String endUserAddress;

    @ApiModelProperty(value = "终端用户联系人")
    private String endUserContact;

    @ApiModelProperty(value = "终端用户联系人电话")
    private String endUserPhone;

    @ApiModelProperty(value = "EC审批材料")
    private String ecAuditFile;

    @ApiModelProperty(value = "EC其他审批材料")
    private String ecAuditOtherFile;

    @ApiModelProperty(value = "附件")
    private String attachment;

    @ApiModelProperty(value = "付款方式")
    private String payType;

    @ApiModelProperty(value = "质保期")
    private String warrantyPeriod;

    @ApiModelProperty(value = "预付比例")
    private BigDecimal prepayRatio;

    @ApiModelProperty(value = "到货情况")
    private String arrivalStatus;

    @ApiModelProperty(value = "订单标准交期（取订单产品最长的交期）")
    private Integer deliveryDate;

    @ApiModelProperty(value = "期望交付计划")
    private String deliveryPlan;

    @ApiModelProperty(value = "订单总额")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "实际支付金额")
    private BigDecimal actualPayPrice;

    @ApiModelProperty(value = "已支付金额")
    private BigDecimal paidPrice;

    @ApiModelProperty(value = "抵扣金额")
    private BigDecimal deductionPrice;

    @ApiModelProperty(value = "优惠券id")
    private String couponId;

    @Dict(dicCode = "mall_order_status")
    @ApiModelProperty(value = "订单状态（草稿；订单审核中；待盖章；待提交预付款；产品排产中；待提交尾款；已完成；已终止）")
    private String status;

    @Dict(dicCode = "mall_order_ec_status")
    @ApiModelProperty(value = "EC状态")
    private String ecStatus;

    @Dict(dicCode = "mall_order_ecRequired")
    @ApiModelProperty(value = "EC是否必填")
    private String ecRequired;

    @ApiModelProperty(value = "EC驳回意见")
    private String ecRejectOpinion;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "复制来源订单id")
    private String copyFromOrderId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "完成时间")
    private LocalDateTime completeTime;

    @ApiModelProperty("产品列表")
    @NotEmpty(message = "产品列表不能为null")
    private List<OrderItemModel> orderItemList;

    @ApiModelProperty("是否可编辑")
    private Boolean canEdit;

    @ApiModelProperty("是否可支付")
    private Boolean canPay;

    @ApiModelProperty("是否可处理ec")
    private Boolean canAuditEc;

    @ApiModelProperty("是否可下载合同")
    private Boolean canDownloadContract;

    @ApiModelProperty("是否可上传双章合同")
    private Boolean canUploadContract;
}
